/*
 * @lc app=leetcode.cn id=70 lang=javascript
 *
 * [70] 爬楼梯
 */

// @lc code=start
/**
 * @param {number} n
 * @return {number}
 */
 var climbStairs = function (n) {
  let res = [];
  for (let i = 1; i <= 45; i++) { 
    if (i < 1) res = null;
  else if (i <= 2) res[i] = i;
  else res[i] = res[i - 1] + res[i - 2];
  }

  return res[n];
};
// @lc code=end

